package com.lagou.edu.utils;

import java.util.Arrays;


public class LogUtils {
/*

    @Pointcut("execution( * com.lagou.edu.service.impl.*.*(..)) ")
    public void pt1(){

    }

    @Before("pt1()")
    public void beforeMethod(JoinPoint joinPoint){
        Object[] args = joinPoint.getArgs();
        for (int i = 0; i < args.length; i++) {
            Object arg = args[i];
            System.out.println(arg);
        }
        System.out.println("开始前的执行, 参数是" + Arrays.toString(args));
    }

    @After("pt1()")
    public void afterMethod(){
        System.out.println("结束后的执行, 无论异常与否");
    }

    @Around("pt1()")
    public void aroundMethod(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
        System.out.println(" 环绕通知中的 before Method ");
        Object result = null;
        try {
            result   = proceedingJoinPoint.proceed();
        }catch (Exception e){
            System.out.println("环绕通知中的 Exception");
        }finally {
            System.out.println(" 后置通知   after Method  ");
        }

        System.out.println("环绕通知");
    }

    @AfterThrowing("pt1()")
    public void exceptionMethod(){
        System.out.println("出现异常的执行");
    }

    @AfterReturning(value = "pt1()", returning = "retValue")
    public void successMethod(Object retValue){
        System.out.println("业务逻辑的正常执行");
    }
*/


}
